import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      title: '首页',
      component: () => import(/* webpackChunkName: "home" */ '../views/HomeView.vue'),
    },
    {
      path: '/video',
      name: 'video',
      title: '视频工具',
      redirect: '/video/videoConversionGif',
      children: [
        {
          path: '/videoConversionGif',
          name: 'videoConversionGif',
          title: '视频转GIF工具',
          component: () => import(/* webpackChunkName: "video-gif" */ '../views/video/videoConversionGif.vue')
        },
        {
          path: '/getVideoAudio',
          name: 'getVideoAudio',
          title: '视频转音频工具',
          component: () => import(/* webpackChunkName: "video-audio" */ '../views/video/getVideoAudio.vue')
        }
      ]
    },
  ],
})

export default router
